package com.example.yibu.modelConfig;

import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;


@Component
public class ConfigQueue {
    private final BlockingQueue<QueueEntity> queueMap = new LinkedBlockingQueue<>();

    public void addQueueTask(QueueEntity queueEntity){
        queueMap.add(queueEntity);
    }

    public QueueEntity getQueueTask() {
        return queueMap.poll();
    }

    public Integer getQueueSize(){
        return queueMap.size();
    }

}
